<?php

namespace App\Models;

namespace App\Models;

use Auth;
use Spatie\Permission\Traits\HasRoles;
use Tymon\JWTAuth\Contracts\JWTSubject;
use Illuminate\Notifications\Notifiable;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Auth\MustVerifyEmail as MustVerifyEmailTrait;
use Illuminate\Contracts\Auth\MustVerifyEmail as MustVerifyEmailContract;

class User extends Authenticatable implements MustVerifyEmailContract, JWTSubject
{
    use Notifiable;

    /**
     * The attributes that are mass assignable.
     *
     * @var array
     */
    protected $fillable = [
        'username', 'mobile', 'password','avatar','pid','real_name','id_number','bank_card','btc_address','bank_name','qrcode'
    ];

    /**
     * The attributes that should be hidden for arrays.
     *
     * @var array
     */
    protected $hidden = [
        'password',
    ];

    public function order(){
        return $this->hasMany(Order::class);
    }

    public function stocksorder(){
        return $this->hasMany(StocksOrder::class);
    }
    public function team(){
        return $this->belongsTo(User::class,'id','pid');
    }

    public function conversion(){
        return $this->hasMany(Conversion::class);
    }
    public function stockstrades(){
        return $this->hasMany(StocksTrades::class);

    }

    public function address(){
        return $this->hasMany(Address::class,'uid','id');
    }

    public function coin(){
        return $this->hasMany(Coin::class);
    }

    public function user_log(){
        return $this->hasMany(UserLog::class);
    }

    public function getJWTIdentifier()
    {
        return $this->getKey();
    }

    public function getJWTCustomClaims()
    {
        return [];
    }
}
